package com.zzh.lib.bar.rom

import android.content.Context
import android.provider.Settings
import com.zzh.lib.core.utils.HResUtils


internal class MiuiRom : BaseRom() {

    override fun fullScreenGestureOn(context: Context): Boolean {
        return Settings.Global.getInt(context.contentResolver, "force_fsg_nav_bar", -1) > 0
    }

    override fun screenIndicatorOn(context: Context): Boolean {
        val navHeight = HResUtils.getNavBarHeight()
        val screenHeight = HResUtils.getDisplayHeight()
        // 当屏幕高度大于状态栏高度的 30 倍时，就认为开启了手势提示线
        // 否则认为没有开启手势提示线
        return navHeight > 0 && screenHeight / navHeight > 30
    }
}